/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "user")
public class User implements Serializable {

    @Id
    @Column(name = "user_id")
    private String userId;
    @Column(name = "ad_name")
    private String adName;
    @Column(name = "user_password")
    private String password;
    @Column(name = "activate")
    private Character activate;
    @OneToMany(mappedBy = "user", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    private List<UserGroup> roles;
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "department_id")
    private Department department;
    @Embedded
    private InfoAudit infoAudit;
    @Column(name = "email")
    private String email;
    @Column(name = "score_point")
    private Integer scorePoint;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Character getActivate() {
        return activate;
    }

    public void setActivate(Character activate) {
        this.activate = activate;
    }

    public List<UserGroup> getRoles() {
        return roles;
    }

    public void setRoles(List<UserGroup> roles) {
        this.roles = roles;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }   

    public Integer getScorePoint() {
        return scorePoint;
    }

    public void setScorePoint(Integer scorePoint) {
        this.scorePoint = scorePoint;
    }

    public String getAdName() {
        return adName;
    }

    public void setAdName(String adName) {
        this.adName = adName;
    }   
    
    
}
